#coding=utf-8
#import libs 
import sys
import Project6_cmd
import Project6_sty
import Fun
import os
import tkinter
from   tkinter import *
import tkinter.ttk
import tkinter.font
from   PIL import Image,ImageTk

#Add your Varial Here: (Keep This Line of comments)
#Define UI Class
class  Project6:
    def __init__(self,root,isTKroot = True):
        uiName = self.__class__.__name__
        self.uiName = uiName
        Fun.Register(uiName,'UIClass',self)
        self.root = root
        self.isTKroot = isTKroot
        Fun.Register(uiName,'root',root)
        style = Project6_sty.SetupStyle()
        if isTKroot == True:
            root.title("Form1")
            Fun.CenterDlg(uiName,root,640,480)
            root['background'] = '#efefef'
            root.bind('<Configure>',self.Configure)
        Form_1= tkinter.Canvas(root,width = 10,height = 4)
        Form_1.pack(fill=BOTH,expand=True)
        Form_1.configure(bg = "#efefef")
        Form_1.configure(highlightthickness = 0)
        Fun.Register(uiName,'Form_1',Form_1)
        #Create the elements of root 
        Label_6 = tkinter.Label(Form_1,text="Label")
        Fun.Register(uiName,'Label_6',Label_6)
        Fun.SetControlPlace(uiName,'Label_6',2,-76,636,556)
        Project6_cmd.ElementBGArray[6]=Image.open("./Resources/何小川.png").convert('RGBA')
        Project6_cmd.ElementBGArray_Resize[6] = Project6_cmd.ElementBGArray[6].resize((636, 556),)
        Project6_cmd.ElementBGArray_IM[6] = ImageTk.PhotoImage(Project6_cmd.ElementBGArray_Resize[6])
        Label_6.configure(image = Project6_cmd.ElementBGArray_IM[6])
        Label_6.configure(relief = "flat")
        Button_13 = tkinter.Button(Form_1,text="Button")
        Fun.Register(uiName,'Button_13',Button_13)
        Fun.SetControlPlace(uiName,'Button_13',228,164,100,28)
        Button_13.configure(command=lambda:Project6_cmd.Button_13_onCommand(uiName,"Button_13"))
        Button_14 = tkinter.Button(Form_1,text="Button")
        Fun.Register(uiName,'Button_14',Button_14)
        Fun.SetControlPlace(uiName,'Button_14',225,208,100,28)
        Button_14.configure(command=lambda:Project6_cmd.Button_14_onCommand(uiName,"Button_14"))
        #Inital all element's Data 
        Fun.InitElementData(uiName)
        #Add Some Logic Code Here: (Keep This Line of comments)



        #Exit Application: (Keep This Line of comments)
        if self.isTKroot == True:
            self.root.protocol('WM_DELETE_WINDOW', self.Exit)
    def Exit(self):
        if self.isTKroot == True:
            self.root.destroy()

    def Configure(self,event):
        if self.root == event.widget:
            pass
#Create the root of Kinter 
if  __name__ == '__main__':
    root = tkinter.Tk()
    MyDlg = Project6(root)
    root.mainloop()
